package com.antler.smt.admin.controller;

import com.antler.smt.response.admin.GetUserListResp;
import com.antler.smt.response.base.Result;
import com.antler.smt.service.portal.MatchUserService;
import com.antler.smt.utils.LogUtil;
import com.antler.smt.validate.DataValidator;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 商务专员匹配项目专员
 *
 * @author zhangyi
 * @date 2018/6/7 19:00
 */
@RestController
@RequestMapping("/matchBusinessUser")
@Api(description = "商务专员匹配项目专员")
public class MatchUserController {

    /**
     * 日志
     */
    private static Logger log = LogUtil.get();

    @Resource
    private MatchUserService matchUserService;

    /**
     * 匹配项目专员
     *
     * @param orderId 订单id
     * @return Result实体
     */
    @PostMapping("/matchUserInfo")
    @ApiOperation(value = "匹配项目专员", httpMethod = "POST")
    public Result<GetUserListResp> listUserInfo(@RequestParam(value = "orderId") Long orderId){
        DataValidator.isBlank(String.valueOf(orderId),"订单id不能为空！");
        Result result = null;
            result = matchUserService.getMatchUserInfo(orderId);
        return result;
    }
}
